require(['jquery','swiper','underscore','api'], function ($,swiper,_,api) {
  _.templateSettings = _templateSettings;

  var caseId = GetRequest().id,
    detailUrl = api.baseUrl+api.case.detail,
    recommendsUrl = api.baseUrl+api.case.recommends;

  var swiper;

  $.get(detailUrl,{id: caseId}, function (res) {
    var data = res.data;
    $('.navv').append(_.template($('#case-detail-title-tpl').html())({data: data.title}));
    $('.main').append(_.template($('#case-detail-tpl').html())({data: data}));
    swiper = new Swiper("#case-swiper",{
      speed: 1000,
      autoplay: 5000
    });
  })

  $(".main").on("click",".other-picture img", function () {
    var idx = $(this).index();
    swiper.slideTo(idx);
  })

});